615e71e
@@ -133,27 +133,16 @@
private void copyMmPath() throws LoginException, IOException {
     return validPaths;
   }
 
-
   /**
    * This needs the root data directory to which the data needs to be exported to.
    * The data export here is a list of files either in table/partition that are written to the _files
-   * in the exportRootDataDir provided.
+   * in the exportRootDataDir provided. In case of MM/ACID tables, we expect this pathlist to be
+   * already passed as valid paths by caller based on ValidWriteIdList. So, mmCtx is ignored here.
    */
   private void exportFilesAsList() throws SemanticException, IOException {
     try (BufferedWriter writer = writer()) {
-      if (mmCtx != null) {
-        assert dataPathList.size() == 1;
-        Path dataPath = dataPathList.get(0);
-        ValidWriteIdList ids = AcidUtils.getTableValidWriteIdList(
-            hiveConf, mmCtx.getFqTableName());
-        List<Path> validPaths = getMmValidPaths(ids, dataPath);
-        for (Path mmPath : validPaths) {
-          writeFilesList(listFilesInDir(mmPath), writer, AcidUtils.getAcidSubDir(dataPath));
-        }
-      } else {
-        for (Path dataPath : dataPathList) {
-          writeFilesList(listFilesInDir(dataPath), writer, AcidUtils.getAcidSubDir(dataPath));
-        }
+      for (Path dataPath : dataPathList) {
+        writeFilesList(listFilesInDir(dataPath), writer, AcidUtils.getAcidSubDir(dataPath));
       }
     }
   }
